with Interfaces.C; use Interfaces.C;
with SDL_stdinc_h;
with SDL_video_h;
with System;

package SDL_mouse_h is

  --  arg-macro: function SDL_BUTTON (X)
  --    return 2 ** ((X)-1);

  SDL_BUTTON_LEFT : constant := 1;  --  SDL_mouse.h:120
  SDL_BUTTON_MIDDLE : constant := 2;  --  SDL_mouse.h:121
  SDL_BUTTON_RIGHT : constant := 3;  --  SDL_mouse.h:122
  SDL_BUTTON_WHEELUP : constant := 4;  --  SDL_mouse.h:123
  SDL_BUTTON_WHEELDOWN : constant := 5;  --  SDL_mouse.h:124
  SDL_BUTTON_X1 : constant := 6;  --  SDL_mouse.h:125
  SDL_BUTTON_X2 : constant := 7;  --  SDL_mouse.h:126
  --  unsupported macro: SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
  --  unsupported macro: SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
  --  unsupported macro: SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
  --  unsupported macro: SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
  --  unsupported macro: SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)


  --

  -- Include file for SDL mouse event handling
  -- Set up for C function definitions, even when using C++
  -- Implementation dependent
   --  skipped empty struct WMcursor

  -- The area of the mouse cursor
   type SDL_Cursor_save_array is array (0 .. 1) of access SDL_stdinc_h.Uint8;
   type SDL_Cursor is record
      area : aliased SDL_video_h.SDL_Rect;  -- SDL_mouse.h:40:11
      hot_x : aliased SDL_stdinc_h.Sint16;  -- SDL_mouse.h:41:9
      hot_y : aliased SDL_stdinc_h.Sint16;  -- SDL_mouse.h:41:16
      data : access SDL_stdinc_h.Uint8;  -- SDL_mouse.h:42:9
      mask : access SDL_stdinc_h.Uint8;  -- SDL_mouse.h:43:9
      save : aliased SDL_Cursor_save_array;  -- SDL_mouse.h:44:15
      wm_cursor : System.Address;  -- SDL_mouse.h:45:12
   end record;
   pragma Convention (C, SDL_Cursor);  -- SDL_mouse.h:39:27

  -- The "tip" of the cursor
  -- B/W cursor data
  -- B/W cursor mask
  -- Place to save cursor area
  -- Window-manager cursor
  -- Function prototypes
  -- * Retrieve the current state of the mouse.
  -- * The current button state is returned as a button bitmask, which can
  -- * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
  -- * current mouse cursor position.  You can pass NULL for either x or y.
  --

   function SDL_GetMouseState (x : access int; y : access int) return SDL_stdinc_h.Uint8;  -- SDL_mouse.h:55:63
   pragma Import (C, SDL_GetMouseState, "SDL_GetMouseState");

  -- * Retrieve the current state of the mouse.
  -- * The current button state is returned as a button bitmask, which can
  -- * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
  -- * mouse deltas since the last call to SDL_GetRelativeMouseState().
  --

   function SDL_GetRelativeMouseState (x : access int; y : access int) return SDL_stdinc_h.Uint8;  -- SDL_mouse.h:63:71
   pragma Import (C, SDL_GetRelativeMouseState, "SDL_GetRelativeMouseState");

  -- * Set the position of the mouse cursor (generates a mouse motion event)
  --

   procedure SDL_WarpMouse (x : SDL_stdinc_h.Uint16; y : SDL_stdinc_h.Uint16);  -- SDL_mouse.h:68:62
   pragma Import (C, SDL_WarpMouse, "SDL_WarpMouse");

  -- * Create a cursor using the specified data and mask (in MSB format).
  -- * The cursor width must be a multiple of 8 bits.
  -- *
  -- * The cursor is created in black and white according to the following:
  -- * data  mask    resulting pixel on screen
  -- *  0     1       White
  -- *  1     1       Black
  -- *  0     0       Transparent
  -- *  1     0       Inverted color if possible, black if not.
  -- *
  -- * Cursors created with this function must be freed with SDL_FreeCursor().
  --

   function SDL_CreateCursor
     (data : access SDL_stdinc_h.Uint8;
      mask : access SDL_stdinc_h.Uint8;
      w : int;
      h : int;
      hot_x : int;
      hot_y : int) return access SDL_Cursor;  -- SDL_mouse.h:84:64
   pragma Import (C, SDL_CreateCursor, "SDL_CreateCursor");

  -- * Set the currently active cursor to the specified one.
  -- * If the cursor is currently visible, the change will be immediately
  -- * represented on the display.
  --

   procedure SDL_SetCursor (cursor : access SDL_Cursor);  -- SDL_mouse.h:91:62
   pragma Import (C, SDL_SetCursor, "SDL_SetCursor");

  -- * Returns the currently active cursor.
  --

   function SDL_GetCursor return access SDL_Cursor;  -- SDL_mouse.h:96:56
   pragma Import (C, SDL_GetCursor, "SDL_GetCursor");

  -- * Deallocates a cursor created with SDL_CreateCursor().
  --

   procedure SDL_FreeCursor (cursor : access SDL_Cursor);  -- SDL_mouse.h:101:63
   pragma Import (C, SDL_FreeCursor, "SDL_FreeCursor");

  -- * Toggle whether or not the cursor is shown on the screen.
  -- * The cursor start off displayed, but can be turned off.
  -- * SDL_ShowCursor() returns 1 if the cursor was being displayed
  -- * before the call, or 0 if it was not.  You can query the current
  -- * state by passing a 'toggle' value of -1.
  --

   function SDL_ShowCursor (toggle : int) return int;  -- SDL_mouse.h:110:54
   pragma Import (C, SDL_ShowCursor, "SDL_ShowCursor");

  -- Used as a mask when testing buttons in buttonstate
  --   Button 1:	Left mouse button
  --   Button 2:	Middle mouse button
  --   Button 3:	Right mouse button
  --   Button 4:	Mouse wheel up	 (may also be a real button)
  --   Button 5:	Mouse wheel down (may also be a real button)
  --

  -- Ends C function definitions when using C++
end SDL_mouse_h;
